<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>影评中心</title>
    <%- include common %>
</head>

<body>
    <%- include('head',{title:'movies',username:username})%>

        <div class="container" style="margin-top: 60px;margin-bottom: 30px;z-index: 999;">
            <h2 class="text-success">电影中心</h2>
            <button type="button" class="btn btn-primary" onclick="location.href='/movies'">默认排序</button>
            <button type="button" class="btn btn-primary" onclick="location.href='/moviesyear'">按年份排序</button>
            <button type="button" class="btn btn-primary" onclick="location.href='/moviesaverage'">按评分排序</button>
        </div>
        <div class="container" style="margin-top: 10px;">
            <div class="row container">
                <div class="col-md-4 " style="display: flex;align-items: flex-start ;">
                    <form action="/moviesserach" method="GET">
                        <div class="form-group">
                            <label for="mvname"></label>
                            <input type="type" name="mvname" class="form-control" id="mvname" placeholder="输入电影名">
                        </div>
                        <button type="submit" class="btn btn-warning" style="margin-top: -84px;margin-left: 200px;">搜索</button>
                    </form>
                </div>
            </div>
        </div>

        <div class="container-fluid container" style="margin-bottom: 60px;z-index: 1000;">
            <%   result.forEach((item,i)=>{ %>
                <div class="col-md-3 mv-item">
                    <a href="/detail?mid=<%- item.id%>" style="display: block; ">
                        <div style="height: 260px; margin-top: 20px;">
                            <img style="height: 100%;;" src="<%- item.images.large.replace(/img7/,'img3') %>" alt="">
                        </div>
                        <h4>片名：
                            <%- item.title%>
                                </h3>
                                <p> 年份:
                                    <%- item.year%>
                                </p>
                                <h5>类型:
                                    <%- item.genres%>
                                </h5>
                                <h5>评分：
                                    <%- item.rating.average%>
                                </h5>
                    </a>
                </div>
                <%     })   %>
        </div>


        <%- include foot%>

</body>

</html>